let arr1
let arr2
let ye
let tiao=10;
let jiye=0
let a


function huanyei(date){
   a=$(date).eq(0).text()
  console.log(arr2);
  fenyei(arr1,arr2,a)
}
function zuo(){
  if(a==1){
    a=6
  }else{
    a=a-1
  }

fenyei(arr1,arr2,a)
}

function you(){
  if(a==6){
    a=1
  }else{
    a++
  }

fenyei(arr1,arr2,a)
}

function zhaopingzhiwei(){
  $("#zhiwei").css({
    "color":"#50CBC4",
    'border-bottom':'3px solid #50CBC4'
  });
  $("#gonsi").css({
    "color":"#fff",
    'border':'none'
  });
  $('#center').html('')
  $.ajax({
    url: '/gsjjzjk',
    method: 'post',
    data: { gongsiid },
    success: (res) => {
      arr1=res.date
      arr2=res.date1
      ye=Math.ceil((res.date1.length)/10)
      fenyei(res.date,res.date1,1)


// console.log(ye);

    
    
    
    }
  })
  
}
  
function fenyei(date,date1,p){
  $('#center').html('')
  jiye=p*10
  if(jiye>date1.length){
    jiye=date1.length
  }
  for(let i=(p-1)*10;i<jiye;i++){
let j
if(i<=9){
  j=i
}else{
   j=i-((p-1)*10)
}
console.log(j);
    $('#center').append(`
    <div class="row cen1">
        <div class="col-lg-1"></div>
        <div class="col-lg-6">
          <div class="row">
            <div class="col-lg-4">
              <div class="row">
                <div class="col-lg-2"></div>
                <div class="col-lg-5">
                  <h5 class="zhiweimincheng"></h5>
                </div>
                <div class="col-lg-2"></div>
                <div class="col-lg-3">
                  <span class="jine">3k-6k</span>
                </div>
              </div>
              <div class="row c11">
                <div class="col-lg-2"></div>
                <div class="col-lg-2">
                  <p class='dizhi'>广州</p>
                </div>
                <div class="col-lg-1"></div>
                <div class="col-lg-2">
                  <p class='nianxian'></p>
                </div>
                <div class="col-lg-2"></div>
                <div class="col-lg-2">
                  <p class='xueli'></p>
                </div>
              </div>
            </div>
            <div class="col-lg-3"></div>
            <div class="col-lg-3">
              <div class="row c12">
                <div class="col-lg-2">
                  <img src="../images/QQ图片20220111155509.png" alt="">
                </div>
                <div class="col-lg-1"></div>
                <div class="col-lg-2">
                  <p>杨丽</p>
                </div>
                <div class="col-lg-1"></div>
                <div class="col-lg-5 c125">
                  <div class="c12d"></div>
                  <p class="c12p">
                    招聘HR
                  </p>
                </div>
              </div>
              <span class="c12s"></span>
            </div>
            <div class="col-lg-2"></div>
  
          </div>
        </div>
        <div class="col-lg-3">
          <div class="row">
            <div class="col-lg-6">
              <h4></h4>
              <div class="row">
                <div class="col-lg-4">
                  <p>物流行业</p>
                </div>
                <div class="col-lg-1"></div>
                <div class="col-lg-7 c125">
                  <div class="c13d"></div>
                  <p class="c13p">
                    <span></span>人以上
                  </p>
                </div>
              </div>
            </div>
            <div class="col-lg-5">
              <img class="c13i" src="" alt="">
            </div>
  
          </div>
        </div>
      </div>
    </div>
    `)
   console.log(date1[i].job_name);
    let str1 = `${date[0].c_name}`
    let str2 = `${date[0].c_address}`
    str1 = str1.substr(0, str1.lastIndexOf('有'))
   let  str3 = str2.substr(str2.lastIndexOf('省')+1, str2.lastIndexOf('市'))
   str3=str3.substr(0, str3.lastIndexOf('市'))
let str4=`${date1[i].j_date}`
str4=str4.substring(0,10) 
    $('.zhiweimincheng').eq(j).html(`${date1[i].job_name}`)
    $('.jine').eq(j).html(`${date1[i].j_money}`)
    $('.dizhi').eq(j).html(`${str3}`)
    $('.nianxian').eq(j).html(`${date1[i].j_age}`)
    $('.xueli').eq(j).html(`${date1[i].j_edu}`)
    $('.c12s').eq(j).html(`&nbsp;&nbsp;&nbsp;&nbsp;发布于&nbsp;&nbsp;&nbsp;${ str4}`)
    $('.cen1 h4').html(`${str1}`)
    $('.c13i').attr('src', `${date[0].c_logourl}`)
    $('.c13p>span').html(`${date[0].c_size}`)
  }

  $('#center').append(`
    <div class='row'>
    <div class="col-lg-1"></div>
    <div class="col-lg-9">
    <nav aria-label="Page navigation">
    <ul class="pagination pagination-lg">
      <li>
       <span aria-label="Previous" onclick='zuo()'>
          <span aria-hidden="true">&laquo;</span>
        </span>
      </li>
   
      <li>
        <span aria-label="Next" onclick='you()'>
          <span aria-hidden="true">&raquo;</span>
        </span>
      </li>
    </ul>
    </nav>
    </div>
    </div>
   
    `)
    for(let i=ye;i>=1;i--){
      $('nav li').eq(0).after(`<li onclick='huanyei(this)'> <span> ${i}</span></li>`)
   
    }
}


function gongsijianjie(){
  $.ajax({
    url: '/gsjjzjk',
    method: 'post',
    data: { gongsiid },
    success: (res) => {
      let str = `${res.date[0].c_intr}`
      let str1 = `${res.date[0].c_name}`
      let str2 = `${res.date[0].c_address}`
      str1 = str1.substr(0, str1.lastIndexOf('有'))
      str2=str2.substr(str2.lastIndexOf('省')+1)
     let str3 = str2.substr(str2.lastIndexOf('市'), str2.lastIndexOf('县'))
      if (str3 == '') {
        str3 = str2.substr(str2.lastIndexOf('市') + 1, str2.lastIndexOf('区'))
        str3=str3.substr(0, str3.lastIndexOf('区')+1)
      }
      console.log(str3);
      str2 = str2.substr(0, str2.lastIndexOf('市')) + str3
      for (let i = 0; i < 3; i++) {
        $('.c22 h4').eq(i).html(`${res.date1[i].job_name}`)
        $('.c22 span').eq(i).html(`${res.date1[i].j_money}`)
        $('.c22 img').eq(i).html(`${res.date[0].c_logourl}`)
        $('.c22 p').eq(i).html(`${str1 + ' - ' + str2}`)
      }
      $(".zizhaoren").html(`${res.date1.length}`)
      $('#shani').attr('src', `${res.date[0].c_logourl}`)
      $('#gsname').html(`${res.date[0].c_name}`)
      $("#gongsiguimo").html(`${res.date[0].c_size}`)
      $(".c22dp>p").eq(0).html(`&emsp;&emsp;${str.substr(0, str.lastIndexOf('/'))}`)
      $(".c22dp>p").eq(1).html(`&emsp;&emsp;${str.substr(str.lastIndexOf('/') + 1)}`)
      $('#gongshanxinxi').html(`${res.date[0].c_name} <span>来源:天眼查</span>`)
      $(".qytp>img").eq(0).attr('src', `${res.date[0].c_one_showimg}`)
      $(".qytp>img").eq(1).attr('src', `${res.date[0].c_two_showimg}`)
      let gotoAddress = `${res.date[0].c_address}`
      console.log(gotoAddress );
      ditu(gotoAddress)
    }
  })
  $("#gonsi").css({
    "color":"#50CBC4",
    'border-bottom':'3px solid #50CBC4'
  });
  $("#zhiwei").css({
    "color":"#fff",
    'border':'none'
  });
  $('#center').html('')
  $('#center').html(`
  <div class="row c2">
  <div class="col-lg-8"></div>
  <div class="col-lg-2">
    <p onclick="zhaopingzhiwei()">查看全部职位>></p>
  </div>
</div>
<div class="row c22">
  <div class="col-lg-1"></div>
  <div class="col-lg-9">
    <div class="row">
      <div class="col-lg-3">
        <div class="row">
          <div class="col-lg-7">
            <div class="row">
              <div class="col-lg-6">
                <h4>分拣工人</h4>
              </div>
              <div class="col-lg-6">
                <span>3k-4k</span>
              </div>
            </div>
            <div class="row">
              <p>广州新邦物流 - 广州白云区</p>
            </div>
          </div>
          <div class="col-lg-5">
            <img src="../images/QQ图片20220110225122.png" alt="">
          </div>
        </div>
      </div>
      <!-- <div class="col-lg-1"></div> -->
      <div class="col-lg-3 c22d">
        <div class="row">
          <div class="col-lg-7">
            <div class="row">
              <div class="col-lg-6">
                <h4>分拣工人</h4>
              </div>
              <div class="col-lg-6">
                <span>3k-4k</span>
              </div>
            </div>
            <div class="row">
              <p>广州新邦物流 - 广州白云区</p>
            </div>
          </div>
          <div class="col-lg-5">
            <img src="../images/QQ图片20220110225122.png" alt="">
          </div>
        </div>
      </div>
      <!-- <div class="col-lg-2"></div> -->
      <div class="col-lg-3">
        <div class="row">
          <div class="col-lg-7">
            <div class="row">
              <div class="col-lg-6">
                <h4>分拣工人</h4>
              </div>
              <div class="col-lg-6">
                <span>3k-4k</span>
              </div>
            </div>
            <div class="row">
              <p>广州新邦物流 - 广州白云区</p>
            </div>
          </div>
          <div class="col-lg-5">
            <img src="../images/QQ图片20220110225122.png" alt="">
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="row">
  <div class="col-lg-1"></div>
  <div class="col-lg-9">
    <div class="row">
      <div class="col-lg-9">
        <p class="pbiaoqian">公司介绍</p>
        <div class="c22dp">
          <p>&emsp;&emsp; 新邦物流有限公司是一家集公路运输、航空货运代理、城际配送于一体的跨区域、网络型、信息化、并具有供应链管理能力的综合型物流企业。</p>
          <p>
            &emsp;&emsp;以创新、诚信、责任、共赢为核心价值观，致力于推动现代物流的创新与社会发展，公司发展方向是以公路快运为核心并延伸到包裹快递服务，坚持以客为本、智慧流通、超越期待、享受服务的服务理念，致力于做社会信赖的物流行业领先者。
          </p>
        </div>
        <div class="c2gs clear">
          <p class="pbiaoqian">工商信息</p>
          <p id='gongshanxinxi'></p>
          <div class="row">
            <div class="col-lg-6">
              <ul>
                <li>法人代表:<span>111</span></li>
                <li>成立时间:<span>111</span></li>
                <li>企业类型:<span>111</span></li>
                <li>经营状态:<span>111</span></li>
                <li>注册地址:<span>111</span></li>
                <li>统一信用代码:<span>111</span></li>
                <li>经营范围:<span>111</span></li>
              </ul>
            </div>
            <div class="col-lg-6">
              <ul>
                <li>注册资本:<span>111</span></li>
              </ul>
            </div>
          </div>

        </div>
        <div class="gongzuodizhi">
          <p class="pbiaoqian">工作地址</p>
          <p>工作地址:<span id='gongzuodizhi'>广州白云区美盛中心办公楼1212</span></p>
          <div id="container"></div>
        </div>
        <div class="qytp clear">
          <p class="pbiaoqian">企业面貌</p>
          <img src="" alt="">
          <img src="" alt="">
        </div>
      </div>
      <div class="col-lg-3">
        <div class="row">
          <div class="col-lg-2"></div>
          <div class="col-lg-8">
            <p class="pbiaoqian">公司招聘boss</p>
          </div>
        </div>
        <div class="c3">
          <div class="row c2zi">
            <div class="col-lg-2"></div>
            <div class="col-lg-2">
              <img src="../images/QQ图片20220112141104.png" alt="">
            </div>
            <div class="col-lg-2"></div>
            <div class="col-lg-2 c2t">
              <p class="pn"> 金溪</p>
            </div>
            <div class="col-lg-3 c2t">
              <p class="pny">招聘HR</p>
            </div>
          </div>
          <div class="row c2xp">
            <div class="col-lg-2"></div>
            <div class="col-lg-3">
              <p>广州白云区</p>
            </div>
            <div class="col-lg-2"></div>
            <div class="col-lg-3">
              <p>13572458502</p>
            </div>
          </div>
        </div>
        <div class="c3">
          <div class="row c2zi">
            <div class="col-lg-2"></div>
            <div class="col-lg-2">
              <img src="../images/QQ图片20220112141104.png" alt="">
            </div>
            <div class="col-lg-2"></div>
            <div class="col-lg-2 c2t">
              <p class="pn"> 金溪</p>
            </div>
            <div class="col-lg-3 c2t">
              <p class="pny">招聘HR</p>
            </div>
          </div>
          <div class="row c2xp">
            <div class="col-lg-2"></div>
            <div class="col-lg-3">
              <p>广州白云区</p>
            </div>
            <div class="col-lg-2"></div>
            <div class="col-lg-3">
              <p>13572458502</p>
            </div>
          </div>
        </div>
        <div class="c3">
          <div class="row c2zi">
            <div class="col-lg-2"></div>
            <div class="col-lg-2">
              <img src="../images/QQ图片20220112141104.png" alt="">
            </div>
            <div class="col-lg-2"></div>
            <div class="col-lg-2 c2t">
              <p class="pn"> 金溪</p>
            </div>
            <div class="col-lg-3 c2t">
              <p class="pny">招聘HR</p>
            </div>
          </div>
          <div class="row c2xp">
            <div class="col-lg-2"></div>
            <div class="col-lg-3">
              <p>广州白云区</p>
            </div>
            <div class="col-lg-2"></div>
            <div class="col-lg-3">
              <p>13572458502</p>
            </div>
          </div>
        </div>
        <div class="c3">
          <div class="row c2zi">
            <div class="col-lg-2"></div>
            <div class="col-lg-2">
              <img src="../images/QQ图片20220112141104.png" alt="">
            </div>
            <div class="col-lg-2"></div>
            <div class="col-lg-2 c2t">
              <p class="pn"> 金溪</p>
            </div>
            <div class="col-lg-3 c2t">
              <p class="pny">招聘HR</p>
            </div>
          </div>
          <div class="row c2xp">
            <div class="col-lg-2"></div>
            <div class="col-lg-3">
              <p>广州白云区</p>
            </div>
            <div class="col-lg-2"></div>
            <div class="col-lg-3">
              <p>13572458502</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>sd
  `)
}